<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>

</html>
<script>
    function ajax(menubar, url, ch, zifu) {
        var str = ''
        for (const key in zifu) {
            str += `${key}=${zifu[key]}&`
        }
        str = str.slice(0, str.length - 1)
        var xhr = new XMLHttpRequest()
        xhr.open(menubar, menubar == 'get' ? url + '?' + str : url)
        xhr.onreadystatechange = function () {
            if (xhr.readyState == 4) {
                ch(JSON.parse(xhr.responseText))
            }
        }
        xhr.setRequestHeader('content-type','application/x-www-form-urlencoded')
        xhr.send(menubar == 'get'?null:str)
    }
    ajax('get', 'https://yantianfeng.com/api/emotion', function (data) {
        console.log(data);
    }, {page:1,count:5})
</script>